package com.sun.relationship.o2m;

import java.sql.Date;
import java.util.ArrayList;
import java.util.List;

import javax.persistence.CascadeType;
import javax.persistence.DiscriminatorValue;
import javax.persistence.Entity;
import javax.persistence.JoinColumn;
import javax.persistence.OneToMany;

import com.sun.relationship.base.BaseProject;

@Entity
@DiscriminatorValue(value = "o2m")
public class ProjectO2M extends BaseProject {
	private static final long serialVersionUID = 7047196564955443525L;
	private List<Member> members = new ArrayList<>();

	public ProjectO2M() {
	}

	public ProjectO2M(String name, Integer age, Date occDate) {
		super(name, age, occDate);
	}
	
	@OneToMany(cascade = CascadeType.ALL)
	@JoinColumn(name = "PROJECT_ID")
	public List<Member> getMembers() {
		return members;
	}

	public void setMembers(List<Member> members) {
		this.members = members;
	}
}
